#include <iostream>
using namespace std;
class A {
public:
  virtual void show() {cout<<"A"<<endl;}
};
class B : public A{
public:
  void show() {cout<<"B"<<endl;}
};
void fun1(A a) {a.show();}
void fun2(A *p) {p->show();}
int main() {
  B obj;
  fun1(obj);
  fun2(&obj);
}
